# 计算器
# 使用函数返回输入的内容
def get_number(grit):
    while True:
        str_a = input(grit)
        if str_a.isdigit():
            return int(str_a)
        else:
            print('输入格式不对，请输入数字!')

def get_mark():
    while True:
        mark = input('请输入运算符：')
        if mark in '+-*/' and len(mark) == 1:
            return mark
        else:
            print('输入格式不对，请输入运算符!')
def cal():
    a = get_number('请输入数字1：')
    b = get_number('请输入数字2：')
    mark = get_mark()
    if mark == '+':
        result = a + b
    elif mark == '-':
        result = a - b
    elif mark == '*':
        result = a * b
    elif mark == '/':
        result = a / b
    print(f"{a} {mark} {b} = {result}")

if __name__ == '__main__':
    cal()